Treat extended attribute ltfs.mediaPool.name like a virtual extended attribute. Allow both reading and writing, and store in MAM data. #388
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
This pull request includes a fix for the following problem: attempting to read the extended attribute "ltfs.mediaPool.name" will fail with an LTFS_NO_XATTR error:
Description
Previously, this attribute could be written via some special-case code in xattr_set(), and presumably it was designed this way so that the attribute's value could be stored in the LTFS index. But this appears to be unnecessary as I don't see anywhere that this value gets written to the XML index.
Previously, this attribute could not be read at all, and any attempt would fail with LTFS_NO_XATTR. With this change, it can be read as well as written, as it is treated like all other virtual extended attributes.
I have tested this on MacOS 10.15.7 and it works as intended. With a build including this change, I am able to read the attribute:
Type of change
Checklist: